package com.lz.specification.concurrent;
/**
 * TODO..
 *
 * @author: li
 * @date: 2019/1/14
 */
public class ThreadPoolExecutor {
    private static final int COUNT_BITS = Integer.SIZE - 3;
    private static final int COUNT_MASK = (1 << COUNT_BITS) - 1;

    // runState is stored in the high-order bits
    private static final int RUNNING    = -1 << COUNT_BITS;
    private static final int SHUTDOWN   =  0 << COUNT_BITS;
    private static final int STOP       =  1 << COUNT_BITS;
    private static final int TIDYING    =  2 << COUNT_BITS;
    private static final int TERMINATED =  3 << COUNT_BITS;

    public static void main(String[] args) {
        System.out.println(Integer.SIZE );
        System.out.println(Integer.toBinaryString(Integer.SIZE) );
        System.out.println(COUNT_BITS);
        // System.out.println(1 << COUNT_BITS );
        System.out.println(Integer.toBinaryString(COUNT_MASK));
        System.out.println("-------------------------");
        System.out.println(Integer.toBinaryString(RUNNING));
        System.out.println(Integer.toBinaryString(SHUTDOWN));
        System.out.println(Integer.toBinaryString(STOP));
        System.out.println(Integer.toBinaryString(TIDYING));
        System.out.println(Integer.toBinaryString(TERMINATED));


        int i=10;
        System.out.println(1<<10);
    }
}
